package com.garbuz.svnadmin.data
{
	import com.garbuz.svnadmin.dto.GroupTO;

	public class Group
	{
		public static function fromTO(data:GroupTO):Group
		{
			var group:Group = new Group();
			group.name = data.name;
			return group;
		}

		public static function getLabel(name:String):String
		{
			return "[ " + name + " ]";
		}

		public static function isSpecial(groupName:String):Boolean
		{
			return ["admins", "developers", "all"].indexOf(groupName) >= 0;
		}
		
		[Bindable]
		public var name:String;

		public function get label():String
		{
			return getLabel(name);
		}

	}
}
